home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / visual / perl.exe / {app} / Templates / perl / User tool template.pl < prev   
Encoding:
Text File  |  2003-01-11  |  1.3 KB  |  41 lines

  1. # This is code that can be used with OptiPerl's
  2. # %GETFILE%,%GETSELECTION%,%GETPROJECT%,%GETLINE% and 
  3. # %SENDFILE%,%SENDSELECTION%,%SENDPROJECT%,%SENDLINE% parameters
  4.  
  5. # please read the comments below for commenting out lines 
  6. # you do not need.
  7.  
  8. # Code for %SENDLINE%
  9. # Get the active line. The format used to send
  10. # is linenumber<tab>activefilename
  11. # linenumber is 0 indexed. Don't add this line
  12. # if you are not using %SENDLINE%
  13. ($linenum,$activefilename) = split(/\t/,<STDIN>);
  14.  
  15. # Code for %SENDFILE%, %SENDSELECTION%, %SENDPROJECT%
  16. # Don't add the line below if you are not using them
  17. @lines = <STDIN>;
  18.  
  19. # If you are also using arguments, they are here:
  20. $param1 = $ARGV[0];
  21. $param2 = $ARGV[1];
  22.  
  23. # Do now what you want with @lines and the rest of the variables
  24. foreach (@lines) {
  25.  $_ = "\t" . $_
  26. }
  27.  
  28. # Code for %GETLINE%
  29. # Print the line we want to go to and the
  30. # file we want to go to. Don't add this line
  31. # if you are not using %GETLINE%
  32. print "$targetline\t$targetfile";
  33.  
  34. # Code for %GETFILE%,%GETSELECTION%,%GETPROJECT% 
  35. # if you are also using the above parameters
  36. # print the result. Remember that %GETFILE% will
  37. # replace the file in the editor, so you might
  38. # also want to use %n<filename>% to open a new file
  39. # in the editor when using %GETFILE%.
  40.  
  41. print @lines;